package common.meters;

public class Count
{
    long start = System.currentTimeMillis();

    long end;

    public void end()
    {
        end = System.currentTimeMillis();
    }

    public long diff()
    {
        return (end - start);
    }

    public long diffSec()
    {
        return (long) ((double) (diff() / 1000));
    }

    public String toString()
    {
        String result = String.format("Cost Time: %d Ms", diff());
        return result;
    }

    public long reset()
    {
        end();
        start = end;
        return start;
    }

    public static Count newOne()
    {
        return new Count();
    }
}
